import request from '../../request'

export function getSysUserList(params) {
  return request({
    url: 'bdSysUser/getSysUserList',
    method: 'POST',
    data: params
  })
}
export function insertSysUserManager(params) {
  return request({
    url: 'bdSysUser/insertSysUserManager',
    method: 'POST',
    data: params
  })
}
export function updateSysUser(params) {
  return request({
    url: 'bdSysUser/updateSysUser',
    method: 'POST',
    data: params
  })
}
export function getById(id) {
  return request({
    url: `bdSysUser/getById/${id}`,
    method: 'GET'
  })
}
export function deleteById(id) {
  return request({
    url: `bdSysUser/delete/${id}`,
    method: 'DELETE'
  })
}
export function getSysRoles(params) {
  return request({
    url: 'bdSysRole/getSysRoles',
    method: 'POST',
    data: params
  })
}
export function insertRole(params) {
  return request({
    url: 'bdSysRole/insertRole',
    method: 'POST',
    data: params
  })
}
export function deleteRole(params) {
  return request({
    url: 'bdSysRole/deleteRole',
    method: 'DELETE',
    params
  })
}
export function updateRole(params) {
  return request({
    url: 'bdSysRole/updateRole',
    method: 'post',
    data: params
  })
}

// 获取全部菜单
export function getSysMenuAll(params) {
  return request({
    url: 'bdSysMenu/getSysMenuAll',
    method: 'GET',
    params
  })
}
// 保存菜单
export function insertSysMenu(params) {
  return request({
    url: 'bdSysMenu/insertSysMenu',
    method: 'post',
    data: params
  })
}
// 修改菜单
export function updateSysMenu(params) {
  return request({
    url: 'bdSysMenu/updateSysMenu',
    method: 'post',
    data: params
  })
}

// 获取角色下菜单
export function getSysMenuListByRole(params) {
  return request({
    url: 'bdSysMenu/getSysMenuListByRole',
    method: 'GET',
    params
  })
}

// 修改角色下菜单
export function updateSysRoleMenu(params) {
  return request({
    url: 'bdSysRoleMenu/updateSysRoleMenu',
    method: 'POST',
    data: params
  })
}
// 获取角色下拉列表
export function getSysRolesAll(params) {
  return request({
    url: 'bdSysRole/getSysRolesAll',
    method: 'get'
  })
}

// 角色-保存权限
export function insertSysRoleMenu(params) {
  return request({
    url: 'bdSysRoleMenu/insertSysRoleMenu',
    method: 'post',
    data: params
  })
}

// 菜单管理-所有菜单-模糊查询
export function getMenuAll(params) {
  return request({
    url: 'bdSysMenu/getMenuAll',
    method: 'get',
    params
  })
}
// 菜单管理-所有菜单-下拉
export function getMenuSelect(params) {
  return request({
    url: 'bdSysMenu/getMenuAll',
    method: 'get'
  })
}
// 菜单管理-删除
export function deleteMenuById(params) {
  return request({
    url: 'bdSysMenu/delete',
    method: 'DELETE',
    params
  })
}
// 菜单管理-获取菜单详情
export function getMenuInfoById(params) {
  return request({
    url: 'bdSysMenu/getMenuInfo',
    method: 'get',
    params
  })
}

// 部门下拉数据
export function getDepartmentSource(params) {
  return request({
    url: '/bdDepartment/getDepartmentSource',
    method: 'post',
    data: params
  })
}
// 初始化密码
export function reStartPassword(params) {
  return request({
    url: '/bdSysUser/reStartPassword',
    method: 'post',
    params
  })
}
// 科室权限分配
export function updateSysUserDeptCode(params) {
  return request({
    url: '/bdSysUserDeptCode/updateSysUserDeptCode',
    method: 'post',
    data: params
  })
}

// 科室权限分配-查询
export function getSysUserDeptCodeList(params) {
  return request({
    url: '/bdSysUserDeptCode/getSysUserDeptCodeList',
    method: 'get',
    params
  })
}
// 科室权限分配
export function getCostDepartment(params) {
  return request({
    url: '/bdDepartment/getCostDepartment',
    method: 'get',
    params
  })
}

// 用户管理-部门下拉
export function getDepartment(params) {
  return request({
    url: '/bdPerformance/getDepartment',
    method: 'get'
  })
}

